﻿@model KRM.Core.WebPermissionController
@{
    Layout = null;
    List<KRM.Core.WebPermissionDepartment> lstDepartments = ViewBag.Department;
}
<fieldset>
    <legend>Department for: <strong>@Model.Name</strong></legend>
    <div style="padding-left: 30px">
            <input type="hidden" name="id" value="@Model.ID"/>
            @foreach (var item in lstDepartments)
            {
                if (Model.WebPermissionDepartments.FirstOrDefault(a => a.ID == item.ID) != null)
                {
                    <div class="control">
                        <label class="checkbox">
                            <input type="checkbox" name="Department@(item.ID)" checked="checked" value="@item.ID"/>
                            @item.Name
                        </label>
                    </div>
                }
                else
                {
                    <div class="control">
                        <label class="checkbox">
                            <input type="checkbox" name="Department@(item.ID)" value="@item.ID"/>
                            @item.Name
                        </label>
                    </div>
                }

            }
            <input type="submit" class="btn btn-primary" value="Save" style="margin-top: 10px"/>
    </div>
</fieldset>
